local sk__shixue = fk.CreateSkill {

  name = "sk__shixue",

  tags = {  },

}



sk__shixue:addEffect(fk.TargetSpecified, {
  name = "sk__shixue",
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(sk__shixue.name) and data.card.trueName == "slash" and data.firstTarget
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(2, sk__shixue.name)
    data.extra_data = data.extra_data or {}
    data.extra_data.sk__shixue = player.id
  end,
})

sk__shixue:addEffect(fk.CardEffectCancelledOut, {
  name = "#sk__shixue_delay",
  mute = true,
  can_trigger = function(self, event, target, player, data)
    if target == player and data.card.trueName == "slash" and not player:isNude() then
      local e = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard, true)
      if e then
        local use = e.data
        if use.extra_data and use.extra_data.sk__shixue and use.extra_data.sk__shixue == player.id then
          return true
        end
      end
    end
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:broadcastSkillInvoke("sk__shixue")
    room:notifySkillInvoked(player, "sk__shixue", "negative")
    room:askForDiscard(player, 2, 2, true, "sk__shixue", false)
  end,
})

return sk__shixue